package cate.game.role.world.invite.msg;

import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgOutput;
import cate.game.client.msg.id.MsgIdBWorld;
import cate.game.role.world.invite.*;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "邀请任务更新的返还", description = "数据子节点if不为null，则更新对应数据，否则忽略")
public class InviteTaskUpdateResp implements MsgOutput {

    @NoteField(value = "邀请创角任务数据", detail = "if不为null才更新对应数据，否则忽略该节点")
    public InviteCreateTask create;
    @NoteField(value = "邀请登录任务数据", detail = "if不为null才更新对应数据，否则忽略该节点")
    public InviteLoginTask login;
    @NoteField(value = "红包任务数据", detail = "if不为null才更新对应数据，否则忽略该节点")
    public InviteRedPkgTask redPkg;
    @NoteField(value = "邀请等级数据", detail = "if不为null才更新对应数据，否则忽略该节点")
    public InviteLvUpTask lv;

    @Override
    public MsgConfig conf() {
        return MsgIdBWorld.INVITE_TASK_UPDATE_RESP;
    }

    public static InviteTaskUpdateResp build(InviteCreateTask create) {
        InviteTaskUpdateResp resp = new InviteTaskUpdateResp();
        resp.create = create;
        return resp;
    }

    public static InviteTaskUpdateResp build(InviteLoginTask login) {
        InviteTaskUpdateResp resp = new InviteTaskUpdateResp();
        resp.login = login;
        return resp;
    }

    public static InviteTaskUpdateResp build(InviteRedPkgTask redPkg) {
        InviteTaskUpdateResp resp = new InviteTaskUpdateResp();
        resp.redPkg = redPkg;
        return resp;
    }

    public static InviteTaskUpdateResp build(InviteLvUpTask lv) {
        InviteTaskUpdateResp resp = new InviteTaskUpdateResp();
        resp.lv = lv;
        return resp;
    }

    public static InviteTaskUpdateResp build(RoleInvite ri) {
        InviteTaskUpdateResp resp = new InviteTaskUpdateResp();
        resp.create = ri.createTask;
        resp.login = ri.loginTask;
        resp.redPkg = ri.redPkgTask;
        resp.lv = ri.lvUpTask;
        return resp;
    }
}